<template>
    <div class="mainerLeft">
      <div class="g-sd3 u-scroll n-musicsd f-pr j-flag" style="height: 455px">
        <div>
          <h2 class="usersub">
            <a href="#" class="f-fs1 s-fc0 f-ff1">我的歌手</a>
          </h2>
          <h2 class="usersub">
            <a href="#" class="f-fs1 s-fc0 f-ff1">我的视频</a>
          </h2>
          <div class="n-minelst n-minelst-1" style="margin-top: 8px">
            <h2 class="f-ff1">
              <a class="u-btn u-btn-crt f-fr j-flag"><i>新建</i></a>
              <span class="rtitle f-pr" data-action="spread"><i class="tri tri1"></i>创建的歌单<span
                  class="f-pa f-r-black-icon" style="
                    display: inline-block;
                    width: 8px;
                    height: 8px;
                    background-size: cover;
                  "></span><span class="f-r-icon-dis-5"></span>(<span class="j-flag">4</span>)</span>
            </h2>
            <ul class="j-flag f-cb">
              <li v-for="item in itemList" :key="item.id" class="j-iflag z-selected">
                <div class="item f-cb">
                  <div class="left">
                    <a class="avatar"><img :src="item.coverImgUrl" alt="" /></a>
                  </div>
                  <p class="name f-thide">
                    <a class="s-fc0" :title="item.name">{{ item.name }}</a>
                  </p>
                  <p class="s-fc4 f-thide num">{{ item.trackCount }}首</p>
                </div>
                <span class="oper hshow" style="display: none"></span>
              </li>
            </ul>
          </div>
          <div class="n-minelst n-minelst-1">
            <h2 class="f-ff1">
              <span class="rtitle f-pr" data-action="spread"><i class="tri tri1"></i>收藏的歌单<span
                  class="f-pa f-r-black-icon" style="
                    display: inline-block;
                    width: 8px;
                    height: 8px;
                    background-size: cover;
                  "></span><span class="f-r-icon-dis-5"></span>(<span class="j-flag">3</span>)</span>
            </h2>
            <ul class="f-cb j-flag">
              <li v-for="soucang in globalList" :key="soucang.id" class="j-iflag">
                <div class="item f-cb">
                  <div class="left">
                    <a class="avatar"><img :src="soucang.coverImgUrl" alt="" /></a>
                  </div>
                  <p class="name f-thide">
                    <a hidefocus="true" href="javascript:void(0);" class="s-fc0" :title="soucang.name">{{
                      soucang.name
                    }}</a>
                  </p>
                  <p class="s-fc4 f-thide num">
                    {{ soucang.trackCount }}首&nbsp;by
                    {{ soucang.creator.nickname }}
                  </p>
                </div>
                <span class="oper hshow" style="display: none"><a data-action="delete" hidefocus="true" title="删除"
                    href="javascript:void(0);" class="u-icn u-icn-11"></a></span>
              </li>
            </ul>
          </div>
          <div style="height: 100px"></div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  import { reqTopList, gedanxiang } from "@/request/api";
  export default {
    name: "toplistmainerleft",
    data() {
      return {
        itemList: [],
        globalList: [],
      };
    },
    computed: {
      id() {
        if (this.$route.query.id == undefined) return "19723756";
        return this.$route.query.id;
      },
    },
    methods: {
      //切换
      Go(item) {
        this.$router.push({
          path: "/phangbang",
          query: {
            id: item.id,
          },
        });
        this.$bus.$emit("getNum", item.updateFrequency);
      },
    },
    created() {
      //获取排行榜信息
      gedanxiang("1470112871").then((res) => {
        console.log(res.data.playlist);
        this.itemList = res.data.playlist.slice(0, 4);
        this.globalList = res.data.playlist.slice(4);
      });
    },
  };
  </script>
  
  <style scoped lang="less">
  .mainerLeft {
    * {
      list-style: none;
      padding: 0;
      margin: 0;
    }
  
    .g-sd3 {
      overflow-y: auto;
      overflow-x: hidden;
      float: left;
      width: 240px;
    }
  
    .s-fc0 {
      color: #000;
    }
  
    .f-fs1 {
      font-size: 14px;
    }
  
    .f-ff1 {
      font-family: simsun, \5b8b\4f53;
    }
  
    a {
      cursor: pointer;
      text-decoration: none;
      color: #333;
    }
  
    .n-musicsd {
      padding-bottom: 50px;
      padding-top: 40px;
  
      h2 {
        // padding: 0;
        // margin: 0;
      }
  
      .usersub {
        position: relative;
        height: 36px;
        line-height: 36px;
  
        a {
          display: block;
          padding: 0 5px 2px 35px;
        }
      }
  
      .n-minelst {
        h2 {
          padding: 0 10px 12px 15px;
          font-size: 14px;
          color: #000;
        }
  
        .rtitle {
          cursor: pointer;
        }
  
        .tri1 {
          border-color: #ccc transparent transparent;
          border-style: solid dashed dashed;
          border-width: 8px 7px 0;
        }
  
        .tri {
          display: inline-block;
          vertical-align: middle;
          margin: 0 2px 0 5px;
          cursor: pointer;
          font-size: 0;
          height: 0;
          line-height: 0;
        }
  
        ul * {
          cursor: pointer;
          vertical-align: middle;
          font-size: 12px;
        }
  
        li.z-selected {
          background: #e6e6e6;
        }
  
        li {
          position: relative;
          height: 42px;
          padding: 6px 0 6px 20px;
        }
  
        .item {
          padding-left: 50px;
        }
  
        .left {
          display: inline;
          float: left;
          margin-left: -50px;
          overflow: hidden;
          width: 40px;
        }
  
        .avatar {
          display: block;
          position: relative;
          width: 40px;
          height: 40px;
  
          img {
            width: 40px;
            height: 40px;
          }
        }
  
        .name {
          // width: 150px;
          overflow: hidden;
          margin-top: 2px;
          margin-bottom: 8px;
  
          a {
            white-space: nowrap;
          }
        }
  
        .num {
          width: 130px;
        }
  
        .oper {
          position: absolute;
          bottom: 7px;
          right: 0;
  
          .u-icn {
            display: inline-block;
            overflow: hidden;
            float: left;
            margin-right: 10px;
            background: url(https://s2.music.126.net/style/web2/img/icon.png?ad18893948ba610ea1ef8778bffb8dbd) no-repeat 0 9999px;
          }
        }
      }
  
      .u-btn {
        display: inline-block;
        background: url(https://s2.music.126.net/style/web2/img/button.png?a3356f2bef5844da6b9fb02bd0c1e1ad) no-repeat 0 9999px;
      }
  
      .u-btn-crt {
        width: 52px;
        height: 52px;
        background-position: 0 -96px;
  
        i {
          display: inline-block;
          line-height: 22px;
          overflow: hidden;
          padding-left: 20px;
          color: #515151;
          font-size: 12px;
          font-weight: normal;
          text-align: left;
        }
      }
  
      .f-fr {
        float: right;
      }
  
      .f-pr {
        position: relative;
      }
  
      .f-pa {
        position: absolute;
      }
  
      .f-r-icon-dis-5 {
        display: inline-block;
        width: 10px;
      }
  
      .u-icn-10 {
        width: 13px;
        height: 13px;
        background-position: 0 -270px;
      }
  
      .u-icn-11 {
        width: 13px;
        height: 14px;
        background-position: 0 -284px;
      }
    }
  }
  </style>